//
// Created by 86131 on 2023/12/18.
//
#include<stdio.h>
int main()
{
    int x,y,k=0;
    while(scanf("%d %d",&x,&y)==2&&x*y)
    {
        if(k)
            printf(" ");
        else
            k=1;
        printf("%d %d",x*y,y-1);
    }
    if(!k)//如果根本没有输入，则输出0 0
        printf("0 0");
    return 0;
}